import request from '@/utils/request'

export default {
  //1.讲师列表（条件查询分页）
  //当前页 每页记录数 teacherQuery
  getTeacherListPage(current, limit, teacherQuery) {
    return request({
      //这里使用模板字符串传递参数
      url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
      method: 'post',
      //data表示把对象转换json进行传递到接口里面
      data: teacherQuery
    })
  },
  //根据id删除讲师
  deleteTeacherId(id) {
    return request({
      url: `/eduservice/teacher/${id}`,
      method: 'delete'
    })
  },
  //添加讲师
  addTeacherId(teacher) {
    return request({
      url: `eduservice/teacher/addTeacher`,
      method: 'post',
      //data表示把对象转换json进行传递到接口里面
      data: teacher
    })
  },
  //根据id查询讲师信息
  getTeacherInfo(id) {
    return request({
      url: `eduservice/teacher/getTeacher/${id}`,
      method: 'get'
    })
  },
  //根据id修改讲师信息
  updateTeacherInfo(teacher) {
    return request({
      url: `/eduservice/teacher/updateTeacher`,
      method: 'post',
      data: teacher
    })
  }
}
